package com.lantosec.hmrp.modules.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.system.vo.SysLoginLogVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * <p>
 *  实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-02-19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysLoginLog extends BaseEntity<SysLoginLogVO> {

    private static final long serialVersionUID = 1L;
    public SysLoginLog(SysLoginLogVO vo){
        this.logId = vo.getLogId();
        this.logIp = vo.getLogIp();
        this.logUserId = vo.getLogUserId();
        this.logTime = vo.getLogTime();
    }

    @Override
    public SysLoginLogVO convertToVO(){
        return new SysLoginLogVO(this);
    }


    /**
     * 日志ID
     */
    @TableId(value = "log_id", type = IdType.ASSIGN_UUID)
    private String logId;

    /**
     * ip地址
     */
    private String logIp;

    /**
     * 操作人
     */
    private String logUserId;

    /**
     * 操作时间
     */
    private Date logTime;


    public enum ColName {
        log_id, log_ip, log_user_id, log_time,
    }
}
